﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;

[Serializable]
public class PipeLine : MonoBehaviour
{
    public float min_Opt = -0.35f;
    public float max_Opt = 4.0f;
    public float speed = 3.0f;

    float t = 0f;

    // Start is called before the first frame update

    void Start()
    {
        Init();
    }
    public void Init()
    {
        //float y = Random.Range(min_Opt, max_Opt);
        transform.localPosition = new Vector3(0, transform.localPosition.y,transform.localPosition.z);
    }

    // Update is called once per frame
    void Update()
    {
        transform.localPosition += Vector3.left * speed * Time.deltaTime;
        t += Time.deltaTime;
        if (t > 8f)
        {
            Destroy(gameObject,1f);
        }
    }
}
